#!/usr/bin/env bash
# -*- encoding: utf-8 -*-
'''
@File    :   maker.sh
@Time    :   2022/12/04
@Author  :   Zhou Lab 
@Version :   1.0
@Contact :    https://github.com/zhouyflab
@License :   (C)Copyright 2021-2022, CAAS ShenZhen
@Desc    :   To annotate the genome 
'''
cd $2_rnd1.maker.output
gff3_merge -s -d $2_rnd1_master_datastore_index.log > $2_rnd1.all.maker.gff
mkdir snap
cd snap
maker2zff -l 50 -x 0.5 ../$2_rnd1.all.maker.gff
fathom genome.ann genome.dna -gene-stats
fathom genome.ann genome.dna -validate
fathom genome.ann genome.dna -categorize 1000
fathom uni.ann uni.dna -export 1000 -plus
mkdir params
cd params
forge ../export.ann ../export.dna
cd ..
hmm-assembler.pl $2_rnd1 params > $2_rnd1.hmm
cd ..
mkdir augustus
cd augustus
grep "maker" ../$2_rnd1.all.maker.gff > $2_rnd1.gff
autoAugTrain.pl --verbose --trainingset $2_rnd1.gff --genome $1 --species $2_rnd1
